package com.epalmpay.service.agent;

import com.epalmpay.dto.agent.*;
import com.epalmpay.dto.member.MemberInDTO;
import com.epalmpay.dto.member.MemberOutDTO;
import com.epalmpay.dto.merchantmanage.GroupOutDTO;
import com.epalmpay.entity.Member;
import com.epalmpay.exception.ApplicationException;
import com.epalmpay.dto.activity.AgentRateInDTO;
import com.epalmpay.dto.activity.AgentRateOutDTO;
import com.epalmpay.dto.member.BalanceInDTO;
import com.epalmpay.dto.prepurchase.PrePurAgentInDTO;
import com.epalmpay.dto.system.BaseOutDTO;
import com.epalmpay.dto.system.PageDTO;
import com.epalmpay.entity.Agent;

import java.util.List;
import java.util.Map;

public interface IAgentService {

	AgentListOutDTO agentList(AgentInDTO agentInDTO,PageDTO pageDTO) throws ApplicationException;
	
	
	AgentListOutDTO groupAgentlist(AgentInDTO agentInDTO,PageDTO pageDTO) throws ApplicationException;

	AgentInfoOutDTO findAgentView(Agent agent)throws ApplicationException;

	Boolean addAgentInfo(AgentInfoInDTO agentInDTO,String url)throws ApplicationException;
	
	/**
	 * 自主注册代理商 不创建钱包
	 * @param agentInDTO
	 * @return
	 * @throws Exception
	 */
	Boolean addAgentInfoVerify(AgentInfoInDTO agentInDTO)throws ApplicationException;
	
	Boolean updateAgentInfo(AgentInfoInDTO agentInfoInDTO) throws ApplicationException ;
	
	/**
	 * 代理商审核修改
	 * @param agentInfoInDTO
	 * @return
	 * @throws ApplicationException
	 */
	Boolean updateAgentVerifyInfo(AgentInfoInDTO agentInfoInDTO) throws ApplicationException ;

	public BaseOutDTO finishStopAgent(Long id) throws ApplicationException;
	
	public void updateAuditAgent(AgentApproveDTO  agentApproveDTO) throws ApplicationException;

	AgentMoreInfoOutDTO findAgentInfoById(Long id)  throws ApplicationException ;
	
	
	AgentRateOutDTO findAgentInfo(Long id)  throws ApplicationException ;
	
	Boolean saveSubSet(AgentRateInDTO agentRateInDTO)  throws ApplicationException ;

	AgentFinanceInfoOut findAgentFinanceInfo(Long id) throws ApplicationException;

    AgentListOutDTO listGroupAgent(AgentInDTO agentInDTO);

	List<Map<String, Object>> listGroupAgent2(Long groupId);


	boolean doPrePurAgentUpdate(PrePurAgentInDTO prePurAgentInDTO)throws ApplicationException;


	SubAgentSetInfoOutDTO findAgentSetInfo(Long agentId, Integer agentLevel)throws ApplicationException;


	Boolean doUpdateAgentProfit(SingleAgentRateInDTO singleAgentRateInDTO)throws ApplicationException;


	Boolean doAgentApprove(AgentInfoInDTO agentInfoInDTO)throws ApplicationException;
	
	
	AgentListOutDTO getProvincelist();
	
	public BaseOutDTO addBalance(BalanceInDTO balanceInDTO,String rootHomeUrl) throws ApplicationException;

    MemberOutDTO queryAgentAmount(AgentInDTO agentInDTO)throws ApplicationException;

    GroupOutDTO queryGroupInfoByGroupId(AgentInDTO agentInDTO)throws ApplicationException;

    MemberOutDTO addAgentBalance(BalanceInDTO balanceInDTO, String root_home_url)throws ApplicationException;

	//重置支付密码
	Agent reSetPayPwd(MemberInDTO memberInDTO, String rootHomeUrl)throws Exception;

	/**
	 * 根据代理商ID，查找对应的代理商名
	 * @param agentId
	 * @return
	 */
	GroupOutDTO getAgentNameById(Long agentId)throws Exception;
}
